<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%><%@ taglib prefix="c"
	uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>都市信息网</title>
<link type="text/css" rel="stylesheet" href="../css/style.css">
<script type="text/javascript">
  function request(paras) {
            var url = location.href;
            var paraString = url.substring(url.indexOf("?") + 1, url.length).split("&");
            var paraObj = { };
            for (i = 0; j = paraString[i]; i++) {
                paraObj[j.substring(0, j.indexOf("=")).toLowerCase()] = j.substring(j.indexOf("=") + 1, j.length);
            }
            var returnValue = paraObj[paras.toLowerCase()];
            if (typeof (returnValue) == "undefined") {
                return "";
            } else {
                return returnValue;
            }
        }
  function check1(info_id){
		$.post("./updateinfo", {
			id : info_id,
			check: 1
		}, function(data) {
				alert(data.msg);
				if(data.status == 200){
					$("#check1").remove();
				}
			/* location.href=data.msg; */
			
		});
  }
  
  function check0(info_id){
		$.post("./updateinfo", {
			id : info_id,
			check: 0
		}, function(data) {
				alert(data.msg);
				if(data.status == 200){
					$("#check0").remove();
				}
		});
}
  function pay0(info_id){
		$.post("./updateinfo", {
			id : info_id,
			pay: 0
		}, function(data) {
				alert(data.msg);
				if(data.status == 200){
					$("#pay0").remove();
				}
		});
  }
		
		 function pay1(info_id){
				$.post("./updateinfo", {
					id : info_id,
					pay: 1
				}, function(data) {
						alert(data.msg);
						if(data.status == 200){
							$("#pay1").remove();
						}
				});
		 }
		 
		 function del(info_id){
				$.post("./updateinfo", {
					id : info_id,
					del: 1
				}, function(data) {
						alert(data.msg);
						if(data.status == 200){
							$("#del").remove();
							window.history.back(-1);
						}
				});
		 }
  </script>
</head>
<body>
	<div align="left">

		<table style="text-align: center; margin-left: 10px;" bgcolor="white"
			border="0" cellpadding="0" cellspacing="0" width="920">

			<tbody>
				<tr>
					<td align="left" height="400" bgcolor="#FFFFFF" valign="top"
						width="690">
						<!-- 列表显示免费信息 -->
						<table style="margin-top: 5" border="0" cellpadding="0"
							cellspacing="0" width="670">
							<c:if test="${!empty info}">
							<tbody>
								<tr height="30">
									<td style="text-indent: 5" valign="bottom"><font
										color="#004790"><b>■查看详细信息</b></font> <c:if
											test="${ sessionScope.user.user_type == 49 && info.info_check == 48}">
											<input id="check1" value="审核通过" onclick="check1(${info.id})"
												type="button">
										</c:if> <c:if test="${sessionScope.user.user_type == 49 && info.info_check == 49}">
											<input id="check0" value="重新审核" onclick="check0(${info.id})"
												type="button">
										</c:if> <c:if test="${sessionScope.user.user_type == 49 &&info.info_payfor == 48}">
											<input id="pay1" value="设置付费" onclick="pay1(${info.id})" type="button">
										</c:if> <c:if test="${sessionScope.user.user_type == 49 && info.info_payfor == 49}">
											<input id="pay0" value="设置免费" onclick="pay0(${info.id})" type="button">
										</c:if><c:if test="${sessionScope.user.user_type == 49}">
											<input id="del" value="删除信息" onclick="del(${info.id})" type="button">
										</c:if>
										
										
										
										<c:if test="${sessionScope.user.user_type == 48 &&  info.info_check == 48 }">
											<label style="color: red;">未审核&nbsp;&nbsp;</label>
										</c:if>
										<c:if test="${sessionScope.user.user_type == 48 &&  info.info_check == 49 }">
											<label>已审核&nbsp;&nbsp;</label>
										</c:if>
										<c:if test="${sessionScope.user.user_type == 48 &&  info.info_payfor == 48 }">
											<label  style="color: red;">未付费&nbsp;&nbsp;</label>
										</c:if>
										<c:if test="${sessionScope.user.user_type == 48 &&  info.info_payfor == 49 }">
											<label>已付费&nbsp;&nbsp;</label>
										</c:if>
										</td>
								</tr>
								<tr height="1">
									<td></td>
								</tr>
								<tr bgcolor="#FAFCF5">
									<td style="border: 1 solid">
										<table style="font-size: 14px;" border="0" cellpadding="2"
											cellspacing="0" width="100%">
											<tbody>
												<tr height="30">
													<td style="text-indent: 20" width="20%">信息类别：</td>
													<td>${info.info_type.type_name }</td>
												</tr>
												<tr height="30">
													<td style="text-indent: 20">发布时间：</td>
													<td>${info.info_date}</td>
												</tr>
												<tr height="30">
													<td style="text-indent: 20">信息标题：</td>
													<td>${info.info_title}</td>
												</tr>
												<tr height="30">
													<td colspan="2" style="text-indent: 20">信息内容：</td>
												</tr>
												<tr height="60">
													<td colspan="2" style="text-indent: 20">${info.info_content }</td>
												</tr>
												<tr height="40">
													<td colspan="2" align="left">
														<table style="word-break: break-all; font-size: 14px;"
															border="0" cellpadding="0" cellspacing="0" width="630">
															<tbody>
																<tr align="left" height="20">
																	<td>联系电话：${info.info_phone }</td>
																	<td>联系人：${info.info_linkman }</td>
																	<td>E-mail：${info.info_email}</td>
																</tr>
															</tbody>
														</table>
													</td>
												</tr>
												<tr height="40">
													<td colspan="2" align="center"><a
														href="javascript:window.history.back(-1)">返回</a></td>
												</tr>
											</tbody>
										</table>
									</td>
								</tr>
							</tbody>
							</c:if>
							<c:if test="${empty info }">
								<tr>
								<td style="color: red;" align="center">信息不存在，请确认ID</td>
								</tr>
								<tr height="40">
									<td colspan="2" align="center"><a
										href="javascript:window.history.back(-1)">返回</a></td>
								</tr>
							</c:if>
						</table> <br>
					</td>
				</tr>
			</tbody>
		</table>
		<!-- 页脚 -->
	</div>
</body>
<script src="../js/jquery.min.js"></script>
<script type="text/javascript">
/*  var type = decodeURI(request("type"));//De=‘未设置’
  	   if(type==1){
  	   	  document.getElementById("payBut").style.display="none";
  	   	}else{
  	   		 document.getElementById("checkBut").style.display="none";
  	   		
  	   		} */
</script>
</html>